#!/bin/bash

set -o errexit

test_dir="$(dirname $0)"
. $(dirname $0)/functions
src_dir="$(realpath $test_dir/..)"

if [[ $BUILD != "0" ]]; then
    echo "building, set BUILD=0 to suppress this"
    $test_dir/build
fi

create_namespace run-$GIT_BRANCH-$RANDOM
deploy_operator

desc 'create PXC cluster'
apply_config $src_dir/deploy/secrets.yaml
apply_config $src_dir/deploy/cr.yaml


wait_for_running cluster1-pxc 3
